home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / NetworkSource.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  29.5 KB  |  822 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsServerHash.inc"-->
  4. <!--#include file="include/wmsPlugins.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsPageBanner.inc"-->
  7. <!--#include file="include/wmsError.inc"-->
  8. <!--#include file="plugin_loading.inc"-->
  9. <%
  10. '+-------------------------------------------------------------------------
  11. '
  12. '  Microsoft Windows Media
  13. '  Copyright (C) Microsoft Corporation. All rights reserved.
  14. '
  15. '  File:       NetworkSource.asp
  16. '
  17. '  Contents:
  18. '
  19. '--------------------------------------------------------------------------
  20.  
  21. ConnectToPlugin
  22. ConnectToPluginAdmin
  23.  
  24. on error goto 0
  25.  
  26. Dim g_bError
  27. Dim dwTabIndex
  28.  
  29. Dim bUdpEnabled
  30. Dim bUseUdpPorts
  31. Dim strUdpPortRange
  32. Dim bTcpEnabled
  33. Dim dwNumProtocols
  34.  
  35. Const WMS_PROXY_SETTING_NONE      = 0
  36. Const WMS_PROXY_SETTING_MANUAL    = 1
  37. Const WMS_PROXY_SETTING_AUTO      = 2
  38. Const WMS_PROXY_SETTING_BROWSER   = 3        ' Only valid for HTTP 
  39.  
  40. dwTabIndex = 0
  41. g_bError = FALSE
  42.  
  43. bUdpEnabled = FALSE
  44. bUseUdpPorts = FALSE
  45. strUdpPortRange = GetPostOrQsVal( "portRange" )
  46. bTcpEnabled = FALSE
  47.  
  48. if( FALSE = IsEmpty( g_objPluginAdmin ) ) then
  49.     dwNumProtocols = g_objPluginAdmin.NumProtocolsSupported
  50. else
  51.     dwNumProtocols = 0
  52. end if
  53.  
  54. Dim strOp
  55. strOp = GetFormStr( "submit" )
  56. if( 0 < Len( strOp ) ) then
  57.  
  58.     on error goto 0
  59.     Err.Clear
  60.     Session( "ErrorNumber" ) = 0
  61.     err.number = 0
  62.     g_bError = FALSE
  63.  
  64.     ' use a do-while-false structure to break out upon first error    
  65.     do
  66.         if ( 0 = StrComp( "on", GetFormStr("useUDP"), vbTextCompare ) ) then
  67.             if( FALSE = g_objPluginAdmin.UDPEnabled ) then
  68.                 g_objPluginAdmin.UDPEnabled = TRUE
  69.                 if( ErrorDetected( "UDP" ) ) then
  70.                     err.description = RemoveDangerousCharacters( L_FAILEDTOENABLEUDP_TEXT )
  71.                     g_bError = TRUE
  72.                     Exit Do
  73.                 end if
  74.             end if
  75.  
  76.             if( "" <> GetFormStr("usePorts") ) then
  77.                 if( 0 = Len( strUdpPortRange ) ) then
  78.                     g_objPluginAdmin.DeleteAllUDPPortRanges
  79.                 else
  80.                     if( FALSE = SetRanges( strUdpPortRange ) ) then
  81.                         if( ErrorDetected( "portRange" ) ) then
  82.                             g_bError = TRUE
  83.                             Exit Do
  84.                         end if
  85.                     end if
  86.                 end if
  87.             else
  88.                 g_objPluginAdmin.DeleteAllUDPPortRanges
  89.             end if
  90.         else
  91.             if( TRUE = g_objPluginAdmin.UDPEnabled ) then
  92.                 g_objPluginAdmin.UDPEnabled = FALSE
  93.                 if( ErrorDetected( "UDP" ) ) then
  94.                     err.description = RemoveDangerousCharacters( L_FAILEDTODISABLEUDP_TEXT )
  95.                     g_bError = TRUE
  96.                     Exit Do
  97.                 end if
  98.             end if
  99.         end if
  100.  
  101.         if ( 0 = StrComp( "on", GetFormStr("useTCP"), vbTextCompare ) ) then
  102.             if( FALSE = g_objPluginAdmin.TCPEnabled ) then
  103.                 g_objPluginAdmin.TCPEnabled = TRUE
  104.                 if( ErrorDetected( "TCP" ) ) then
  105.                     err.description = RemoveDangerousCharacters( L_FAILEDTOENABLETCP_TEXT )
  106.                     g_bError = TRUE
  107.                     Exit Do
  108.                 end if
  109.             end if
  110.                         
  111.         else
  112.             if( TRUE = g_objPluginAdmin.TCPEnabled ) then
  113.                 g_objPluginAdmin.TCPEnabled = FALSE
  114.             end if
  115.             if( ErrorDetected( "TCP" ) ) then
  116.                 err.description = RemoveDangerousCharacters( L_FAILEDTODISABLETCP_TEXT )
  117.                 g_bError = TRUE
  118.                 Exit Do
  119.             end if
  120.         end if
  121.  
  122.     Loop Until TRUE
  123.  
  124.     if ( FALSE = g_bError ) then
  125.         Response.Redirect "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex")
  126.     end if
  127.  
  128. elseif lcase( L_CONFIGUREELLIPSESBUTTON_TEXT ) = lcase( GetFormStr("op") ) then
  129.     Response.Redirect "NetSourceProxy.asp?" & qs
  130. end if
  131.  
  132. if( 0 = Len( strUdpPortRange ) ) then
  133.     on error resume next
  134.     bUdpEnabled = CBool( g_objPluginAdmin.UDPEnabled )
  135.     dwNumRanges = CDbl( g_objPluginAdmin.NumUDPPortRanges )
  136.     bUseUdpPorts = ( 0 = CDbl(g_objPluginAdmin.NumUDPPortRanges ) )
  137.     for iEachRange = 0 to ( dwNumRanges - 1 ) 
  138.         if( ( 0 = g_objPluginAdmin.UDPPortRangeLowerBound( iEachRange) ) or ( g_objPluginAdmin.UDPPortRangeLowerBound( iEachRange) = g_objPluginAdmin.UDPPortRangeUpperBound( iEachRange ) ) ) then
  139.             strUdpPortRange = strUdpPortRange & g_objPluginAdmin.UDPPortRangeUpperBound( iEachRange )
  140.         else
  141.             strUdpPortRange = strUdpPortRange & CStr( g_objPluginAdmin.UDPPortRangeLowerBound( iEachRange )  ) & L_RANGEDELIMITER_TEXT & CStr( g_objPluginAdmin.UDPPortRangeUpperBound( iEachRange ) )
  142.         end if
  143.         if( iEachRange < ( dwNumRanges -1 ) ) then
  144.             strUdpPortRange = strUdpPortRange & L_LISTDELIMITER_TEXT
  145.         end if
  146.     next
  147. else
  148.     bUdpEnabled = TRUE
  149.     bUseUdpPorts = TRUE
  150.     dwNumRanges = 1
  151.     on error goto 0
  152. end if
  153.     
  154. bTcpEnabled = g_objPluginAdmin.TCPEnabled
  155.  
  156.  
  157. '////////////////////////////////////////////////////////////////////////////
  158. '
  159. ' Parse upper and lower bounds from a substring
  160. '
  161. Function ProcessRange( strInput, byRef dwLowerBound, byRef dwUpperBound )
  162.     on error goto 0
  163.     ProcessRange = TRUE
  164.  
  165.     Dim dwOffsetToDash
  166.     Dim rgCurrentRange
  167.     Dim dwNumSubArrayEntries
  168.  
  169.     dwOffsetToDash = InStr( 1, strInput, L_RANGEDELIMITER_TEXT, vbTextCompare )
  170.  
  171.     if( ( Null = dwOffsetToDash ) or ( 0 = dwOffsetToDash ) ) then
  172. '        on error resume next
  173.         on error goto 0
  174.         err.clear
  175.         dwLowerBound = 0
  176.         dwUpperBound = CDbl( strInput )
  177.  
  178.         if( 0 <> err.number ) then
  179.             ProcessRange = FALSE
  180.             Exit Function
  181.         end if
  182.     else
  183.         rgCurrentRange = Split( strInput, "-", -1, 1 )
  184.         dwNumSubArrayEntries = UBound( rgCurrentRange )
  185.  
  186.         if( 1 > dwNumSubArrayEntries ) then
  187.             dwLowerBound = CDbl( rgCurrentRange( 0 ) )
  188.             dwUpperBound = dwLowerBound
  189.         else
  190.             dwLowerBound = CDbl( rgCurrentRange( 0 ) )
  191.             dwUpperBound = CDbl( rgCurrentRange( 1 ) )          
  192.  
  193.             if( dwLowerBound = dwUpperBound ) then
  194.                 dwLowerBound = 0
  195.             end if
  196.         end if
  197.     end if
  198. End Function
  199.  
  200.  
  201. '////////////////////////////////////////////////////////////////////////////
  202. '
  203. ' Parse comma-delimited list for a set of ranges
  204. '
  205. Function SetRanges( strRanges )
  206.  
  207.     Dim bRetVal
  208.     bRetVal = TRUE
  209.     on error resume next
  210.  
  211.     Dim i
  212.     Dim rgRanges
  213.     Dim strCurrentRange
  214.     Dim dwNumArrayEntries
  215.     Dim dwLowerBound
  216.     Dim dwUpperBound
  217.     Dim dwOffsetToComma
  218.     Dim bResult
  219.  
  220.     g_objPluginAdmin.DeleteAllUDPPortRanges
  221.  
  222.     ' Handle the base case
  223.     dwOffsetToComma = InStr( 1, strRanges, L_LISTDELIMITER_TEXT, vbTextCompare )
  224.     if( ( Null = dwOffsetToComma ) or ( 0 = dwOffsetToComma ) ) then
  225.  
  226.         bResult = ProcessRange( strRanges, dwLowerBound, dwUpperBound )
  227.  
  228.         if( 0 = err.number ) then
  229.             Call g_objPluginAdmin.AddUDPPortRange( dwLowerBound, dwUpperBound )
  230.             if( 0 <> err.number ) then
  231.                 bRetVal = FALSE
  232.                 g_bError = TRUE
  233.                 Session( "ErrorDescription" ) = Err.description
  234.                 Session( "ErrorNumber" ) = Err.Number
  235.                 Session( "ErrorCulprit" ) = "portRange"
  236.                 err.clear
  237.             end if
  238.         end if
  239.         Exit Function
  240.  
  241.     else    ' process more than one range
  242.     
  243.         i = 0
  244.         dwNumArrayEntries = 0    
  245.         rgRanges = Split( CStr( strRanges ), L_LISTDELIMITER_TEXT, -1, vbTextCompare )
  246.         dwNumArrayEntries = UBound( rgRanges )
  247.  
  248.         For i = 0 to dwNumArrayEntries
  249.             strCurrentRange = CStr( rgRanges( i ) )
  250.             bResult = ProcessRange( strCurrentRange, dwLowerBound, dwUpperBound )
  251.  
  252.             if( ( TRUE = bResult ) and ( 0 = err.number ) ) then
  253.                 call g_objPluginAdmin.AddUDPPortRange( dwLowerBound, dwUpperBound )
  254.                 if( 0 <> err.number ) then
  255.                     bRetVal = FALSE
  256.                     g_bError = TRUE
  257.                     Session( "ErrorDescription" ) = Err.description
  258.                     Session( "ErrorNumber" ) = Err.Number
  259.                     Session( "ErrorCulprit" ) = "portRange"
  260.                     err.clear
  261.                 end if
  262.             end if
  263.         Next
  264.  
  265.     end if
  266.  
  267.     SetRanges = bRetVal
  268. End Function
  269.  
  270. WriteHTMLHeader( g_strDecodedServerName ) 
  271. %>
  272. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  273. <% WritePluginJSUtils %>
  274. <script language="JavaScript">
  275. <!--
  276. /*@cc_on @*/
  277.  
  278. var g_bAlertedUserToBadPort = false;
  279.  
  280. /////////////////////////////////////////////////////////////////////
  281. function ContainsIllegalPortRangeChars( szPortRange )
  282. {
  283.     <% jsTRY %>
  284.     // disregard white spaces
  285.     szPortRange = szPortRange.replace( /(\s)+/g, "" );
  286.     
  287.     var lenPortRange = szPortRange.length;
  288.     var szNewPortRange = szPortRange.replace( /[^\d,;\-]*/g, "" );
  289.     if( szNewPortRange.length != lenPortRange )
  290.     {
  291.         return( true );
  292.     }
  293.     <% jsCATCH %>
  294.     return( false );
  295. }
  296.  
  297. /////////////////////////////////////////////////////////////////////
  298. function PortListIsLegal( szPortRange )
  299. {
  300.     <% jsTRY %>
  301.     // disregard white spaces
  302.     szPortRange = szPortRange.replace( /(\s)+/g, "" );
  303.  
  304.     var regExpTest = new RegExp( /^(\d{1,5})([,;\-]?\d{1,5})*$/gi );
  305.     if( ! regExpTest.test( szPortRange ) )
  306.     {
  307.         return( false );
  308.     }
  309.     return( true );
  310.     
  311.     <% jsCATCH %>
  312.     return( false );
  313. }
  314.  
  315. //////////////////////////////////////////////////////////////////////////
  316. function ValidatePorts()
  317. {
  318.     <% jsTRY %>
  319.         if( true == document.forms.pluginForm.portRange.disabled )
  320.         {
  321.             document.forms.pluginForm.ok.disabled = false;
  322.             return;
  323.         }
  324.     
  325.         var szRange = new String( document.forms.pluginForm.portRange.value );
  326.         szRange = szRange.replace( /(\s)+/g, "" );
  327.         if( 0 == szRange.length )
  328.         {
  329.             document.forms.pluginForm.ok.disabled = true;
  330.             return;
  331.         }
  332.  
  333.         if( ContainsIllegalPortRangeChars( szRange ) )
  334.         {
  335.             document.forms.pluginForm.ok.disabled = true;
  336.             document.forms.pluginForm.portRange.style.color="#ff0000";
  337.             if( ! g_bAlertedUserToBadPort )
  338.             {
  339.                 g_bAlertedUserToBadPort = true;
  340.                 window.alert( "<%= L_TYPEMISMATCH_TEXT %>" );
  341.             }
  342.             window.status = "<%= L_TYPEMISMATCH_TEXT %>";
  343.             return;
  344.         }
  345.         if( ! PortListIsLegal( szRange ) )
  346.         {
  347.             document.forms.pluginForm.ok.disabled = true;
  348. //            document.forms.pluginForm.portRange.style.color="#ff0000";
  349.             return;
  350.         }
  351.         document.forms.pluginForm.portRange.style.color="#000000";
  352.         document.forms.pluginForm.ok.disabled = false;
  353.         window.status = "";
  354.     <% jsCATCH %>
  355. }
  356.  
  357. //////////////////////////////////////////////////////////////////////////
  358. function EnableUDPPorts()
  359. {
  360.     <% jsTRY %>
  361.         if( ! document.forms.pluginForm.useUDP.checked )
  362.         {
  363.             document.forms.pluginForm.useUDP.checked = true;
  364.         }
  365.  
  366.         if( ! document.forms.pluginForm.usePorts.checked )
  367.         {
  368.             document.forms.pluginForm.usePorts.checked = true;
  369.         }
  370.     <% jsCATCH %>
  371. }
  372.  
  373.  
  374. //////////////////////////////////////////////////////////////////////////
  375. function ToggleUDPPorts( bSimulatedClick )
  376. {
  377.     <% jsTRY %>
  378.         document.forms.pluginForm.ok.disabled = false;
  379.     
  380.         if( bSimulatedClick )
  381.         {
  382.             if( document.forms.pluginForm.useUDP.checked )
  383.             {
  384.                 document.forms.pluginForm.usePorts.checked = ! document.forms.pluginForm.usePorts.checked;
  385.             }
  386.         }
  387.  
  388.         if( ! document.forms.pluginForm.useUDP.checked )
  389.         {
  390.             document.forms.pluginForm.usePorts.disabled = true;
  391.             document.forms.pluginForm.portRange.disabled = true;
  392.             <% if( brMSIE = g_dwBrowserType ) then %>
  393.             portRangeLabel.disabled = true;
  394.             <% end if %>
  395.         
  396.             szPorts = document.forms.pluginForm.portRange.value;
  397.             if( 0 == szPorts.length )
  398.             {
  399.                 document.forms.pluginForm.usePorts.checked = false;
  400.             }
  401.  
  402.             return;
  403.         }
  404.         else
  405.         {
  406.             document.forms.pluginForm.usePorts.disabled = false;
  407.             document.forms.pluginForm.portRange.disabled = false;
  408.             <% if( brMSIE = g_dwBrowserType ) then %>
  409.             portRangeLabel.disabled = false;
  410.             <% end if %>
  411.         }
  412.     
  413.         if( document.forms.pluginForm.usePorts.checked )
  414.         {
  415.             document.forms.pluginForm.usePorts.disabled = false;
  416.             document.forms.pluginForm.portRange.disabled = false;
  417.             <% if( brMSIE = g_dwBrowserType ) then %>
  418.             portRangeLabel.disabled = false;
  419.             <% end if %>
  420.             document.forms.pluginForm.useUDP.checked = true;
  421.             document.forms.pluginForm.portRange.focus();
  422.         
  423.             var szRange = new String( document.forms.pluginForm.portRange.value );
  424.             if( 0 == szRange.length )
  425.             {
  426.                 document.forms.pluginForm.ok.disabled = true;
  427.             }
  428.         }
  429.         else
  430.         {
  431.             document.forms.pluginForm.portRange.disabled = true;
  432.             <% if( brMSIE = g_dwBrowserType ) then %>
  433.             portRangeLabel.disabled = true;
  434.             <% end if %>
  435.         }
  436.     <% jsCATCH %>
  437. }
  438.  
  439. //////////////////////////////////////////////////////////////////////////
  440. function ToggleUDP( bSimulateClick )
  441. {
  442.     <% jsTRY %>
  443.         if( bSimulateClick )
  444.         {
  445.             document.forms.pluginForm.useUDP.checked = ! document.forms.pluginForm.useUDP.checked;
  446.         }
  447.  
  448.         if( document.forms.pluginForm.useUDP.checked )
  449.         {
  450.             document.forms.pluginForm.usePorts.disabled = false;
  451.             document.forms.pluginForm.portRange.disabled = false;
  452.             <% if( brMSIE = g_dwBrowserType ) then %>
  453.             portRangeLabel.disabled = false;
  454.             <% end if %>
  455.         }
  456.         else
  457.         {
  458.             document.forms.pluginForm.usePorts.disabled = true;
  459.             document.forms.pluginForm.portRange.disabled = true;
  460.             <% if( brMSIE = g_dwBrowserType ) then %>
  461.             portRangeLabel.disabled = true;
  462.             <% end if %>
  463.         }
  464.  
  465.         ToggleUDPPorts( false );
  466.     <% jsCATCH %>
  467. }
  468.  
  469. //////////////////////////////////////////////////////////////////////////
  470. function ToggleTCP( bSimulateClick )
  471. {
  472.     <% jsTRY %>
  473.         if( bSimulateClick )
  474.         {
  475.             document.forms.pluginForm.useTCP.checked = ! document.forms.pluginForm.useTCP.checked;
  476.         }
  477.     <% jsCATCH %>
  478. }
  479.  
  480. //////////////////////////////////////////////////////////////////////////
  481. function ToggleTCPHTTP( bSimulateClick )
  482. {
  483.     <% jsTRY %>
  484.         if( bSimulateClick )
  485.         {
  486.             if( ! document.forms.pluginForm.TCPHTTP.disabled )
  487.             {
  488.                 document.forms.pluginForm.TCPHTTP.checked = ! document.forms.pluginForm.TCPHTTP.checked;
  489.             }
  490.         }
  491.     <% jsCATCH %>
  492. }
  493.  
  494. //////////////////////////////////////////////////////////////////////////
  495. // always simulated
  496. function ToggleProxyRadio( dwWhichButton )
  497. {
  498.     <% jsTRY %>
  499.         var element;
  500.         element = document.forms.pluginForm.protocolList[ dwWhichButton ];
  501.         element.checked = true;
  502.     <% jsCATCH %>
  503. }
  504.  
  505. //////////////////////////////////////////////////////////////////////////
  506. function GetCheckedProtocol()
  507. {
  508.     <% jsTRY %>
  509.         var i;
  510.         var e;
  511.     
  512.         //if length is defined, iterate over the elements
  513.         if( document.forms.pluginForm.protocolList.length )
  514.         {
  515.             for( i = 0; i < document.forms.pluginForm.protocolList.length; i++ )
  516.             {
  517.                 e = document.forms.pluginForm.protocolList[ i ];
  518.                 if ( e.checked )
  519.                 {  
  520.                     return e.value;
  521.                 }
  522.             }
  523.         //length isn't defined, so there's only the dummy element
  524.         }
  525.     <% jsCATCH %>
  526.     return null;
  527. }
  528.  
  529. //////////////////////////////////////////////////////////////////////////
  530. function GetSelectedProtocol()
  531. {
  532.     <% jsTRY %>
  533.         var i;
  534.         var e;
  535.     
  536.         //if length is defined, iterate over the elements
  537.         if(document.forms.pluginForm.protocolList)
  538.         {
  539.             for(i = 0; i < document.forms.pluginForm.protocolList.length; i++)
  540.             {
  541.                 e = document.forms.pluginForm.protocolList[i];
  542.                 if (e.checked) 
  543.                 {  
  544.                     return SafeEscape( e.value );
  545.                 }   
  546.             }
  547.         //length isn't defined, so there's only the dummy element
  548.         }
  549.     <% jsCATCH %>
  550.     return null;
  551. }
  552.  
  553. //////////////////////////////////////////////////////////////////////////
  554. function JumpToProxySettings()
  555. {
  556.     <% jsTRY %>
  557.         var szProtocol, szUsePortRange, szPortRange, szUDP, szTCP;
  558.         szProtocol = GetSelectedProtocol();
  559.  
  560.         szUsePortRange = new String( "" );
  561.         if( document.forms.pluginForm.usePorts.checked )
  562.         {
  563.             szUsePortRange = "1";
  564.         }
  565.         else
  566.         {
  567.             szUsePortRange = "0";
  568.         }
  569.  
  570.         szUDP = ( document.forms.pluginForm.useUDP.checked ) ? "1" : "0";
  571.         szTCP = ( document.forms.pluginForm.useTCP.checked ) ? "1" : "0";
  572.  
  573.         szPortRange = new String( document.forms.pluginForm.portRange.value );
  574.  
  575.         document.location.replace( "NetSourceProxy.asp?server=<%= g_strQueryStringServer %>&pluginIndex=<%= qs("pluginIndex") %>&category=<%= g_strCategory %>&protocol=" + szProtocol + "&protocolList=" + szProtocol + "&usePortRange=" + szUsePortRange + "&portRange=" + szPortRange + "&useUDP=" + szUDP + "&useTCP=" + szTCP );
  576.     <% jsCATCH %>
  577. }
  578. -->
  579. </script>
  580. </head>
  581. <body class="pluginBody" onLoad="JavaScript:ToggleUDPPorts( false );ValidatePorts();" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  582. <% DrawPluginBanner %>
  583. <table width="<%= Server.HTMLEncode( STDTABLEWIDTH ) %>">
  584. <tr>
  585.     <td valign=top>
  586.  
  587.         <% WriteStdPluginForm %>
  588.         
  589.         <table cellpadding=0 cellspacing=0 class="propgroupbox" width="100%">
  590.         <caption align="left" class="pluginGroupHeader"><%= Server.HTMLEncode( L_PROTOCOLS_TEXT ) %></caption>
  591.         <tr>
  592.             <td colspan=4>
  593.                 <br> <%= Server.HTMLEncode( L_USESTREAMINGPROTOLS_TEXT ) %><br> 
  594.             </tr>
  595.             <tr>
  596.             <td>
  597.             <br>
  598.             <table width=99% align=center border=0 cellspacing=2 cellpadding=0>
  599.                 <tr>
  600.                     <td colspan=3 ><% dwTabIndex = dwTabIndex + 1 %>
  601.                         <input 
  602.                         type="checkbox" 
  603.                         name="useUDP" 
  604.                         ID="useUDP"
  605.                         value="on" 
  606.                         tabindex=<%= dwTabIndex %> <% 
  607.                         if bUdpEnabled and ( 0 <> StrComp( qs( "useUDP" ), "0", vbTextCompare ) ) then 
  608.                             Response.Write( " checked" ) 
  609.                         end if 
  610.                         %> 
  611.                         onClick="JavaScript:ToggleUDP( false );"
  612.                         >
  613.                         <label for="useUDP" class="handcursor">
  614.                         <% RenderWithErrorCheck Server.HTMLEncode( L_UDPRTSP_TEXT ), "UDP" %></label>
  615.                     </td>
  616.                 </tr>
  617.                 <tr>
  618.                     <td width=10 > </td>
  619.                     <td width=4% align=left > </td>
  620.                     <td align=left nowrap><% dwTabIndex = dwTabIndex + 1 %>
  621.                         <input
  622.                         type="checkbox"
  623.                         name="usePorts"
  624.                         value="on"
  625.                         ID="usePorts"
  626.                         tabindex=<%= dwTabIndex %> <%
  627.                             if( ( 0 < Len( strUdpPortRange ) ) and ( 0 <> StrComp( qs( "usePortRange" ), "0", vbTextCompare ) ) )then
  628.                                 Response.Write( " checked" )
  629.                             end if %>
  630.                         onClick="JavaScript:ToggleUDPPorts( false );"
  631.                         >
  632.                         <label nowrap for="usePorts" class="handcursor" ID="portRangeLabel" name="portRangeLabel">
  633.                         <% RenderWithErrorCheck Server.HTMLEncode( L_DATAPORTS_TEXT ), "portRange" %></label>
  634.                         
  635.                     </td>
  636.                     <td align=left><% dwTabIndex = dwTabIndex + 1 %>
  637.                         <input 
  638.                         type="text" 
  639.                         name="portRange" 
  640.                         size="40"
  641.                         maxlength="255"
  642.                         value="<%= RemoveSpecifiedChars( strUdpPortRange, REGEXP_DANGEROUS_CHARS ) %>" 
  643.                         tabindex=<%= dwTabIndex %> 
  644.                         onKeyDown="JavaScript:ValidatePorts();"
  645.                         onKeyUp="JavaScript:ValidatePorts();"
  646.                         onChange="JavaScript:EnableUDPPorts();ValidatePorts();"
  647.                         onPaste="JavaScript:EnableUDPPorts();ValidatePorts();"
  648.                         <% if ( 0 = Len( strUdpPortRange ) ) then
  649.                             Response.Write( " disabled " )
  650.                         end if %> > <br>
  651.                     </td>
  652.                     <td width=20% align=left > </td>
  653.                     <td> </td>
  654.                 </tr>
  655.                 <tr>
  656.                     <td colspan=3><% dwTabIndex = dwTabIndex + 1 %>
  657.                         <input 
  658.                         type="checkbox" 
  659.                         name="useTCP" 
  660.                         ID="useTCP"
  661.                         value="on" 
  662.                         tabindex=<%= dwTabIndex %> <% 
  663.                         if bTcpEnabled and ( 0 <> StrComp( qs( "useTCP" ), "0", vbTextCompare ) ) then 
  664.                             Response.Write( " checked" ) 
  665.                         end if %>
  666.                         onClick="JavaScript:ToggleTCP( false );">
  667.                         <label for="useTCP" class="handcursor"><% RenderWithErrorCheck Server.HTMLEncode( L_TCP_TEXT ), "TCP" %></span><br>
  668.                     </td>
  669.                 </tr>
  670.             </table>
  671.             </td>
  672.         </tr>
  673.         </table>
  674.     </td>
  675. </tr>
  676. <tr>
  677.     <td>
  678.     <%
  679.         if 0 < dwNumProtocols then 
  680.     %>
  681.         <br>
  682.         <table cellpadding=0 cellspacing=0 class="propgroupbox" width="100%">
  683.         <caption align="left" class="pluginGroupHeader"><%= Server.HTMLEncode( L_PROXYSETTINGS_TEXT ) %></caption>
  684.         <tr>
  685.             <td colspan=4>
  686.                 <br> <%= Server.HTMLEncode( L_CONFIGUREPROTOCOL_TEXT ) %><br> 
  687.             </tr>
  688.             <tr>
  689.                 <td width=5>
  690.                      
  691.                 </td>
  692.                 <td>
  693.                     <table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td>
  694.                         <table cellpadding=0 cellspacing=0 border=1 bordercolor="silver" width=100% class="protocolTable">
  695.                         <th class="colheader">
  696.                               <%= Server.HTMLEncode( L_PROTOCOL_TEXT ) %>
  697.                         </th>
  698.                         <th class="colheader">
  699.                               <%= Server.HTMLEncode( L_PROXY_TEXT ) %>
  700.                         </th>
  701.                         <tr>
  702.                             <td colspan=2><img src="img/hr.gif" width=100% height=2></td>
  703.                         </tr>
  704.                             
  705.                         <% 
  706.                         Dim strProtocol
  707.                         Dim strProxyHostName
  708.                         Dim dwProxyPort
  709.                         Dim bSomethingChecked
  710.                         Dim displayedElement
  711.                         Dim dwProxySetting
  712.  
  713.                         displayedElement = -1
  714.                             
  715.                         bSomethingChecked = FALSE
  716.                         for i = 0 to ( dwNumProtocols - 1 )
  717.                             strProtocol = ""
  718.                             strProxyHostName = ""
  719.                                 
  720.                             Err.Clear
  721.                             strProtocol = g_objPluginAdmin.SupportedProtocolName( i )
  722.                             dwProxySetting = g_objPluginAdmin.ProxySettings( strProtocol )
  723.                             if( WMS_PROXY_SETTING_NONE = dwProxySetting ) then
  724.                                 strProxyHostName = CStr( "" )
  725.                                 dwProxyPort = CDbl( 0 )
  726.                             else
  727.                                 strProxyHostName = g_objPluginAdmin.ProxyHostName( strProtocol )
  728.                                 dwProxyPort = g_objPluginAdmin.ProxyPort( strProtocol )
  729.                             end if
  730.                                 
  731.                             if( "" = strProxyHostName ) then
  732.                                 strProxyHostName = L_NONE_TEXT
  733.                             else
  734.                                 strProxyHostName = strProxyHostName & ":" & dwProxyPort
  735.                             end if
  736.                                 
  737.                             if( 0 = err.number ) then
  738.                                 displayedElement = displayedElement + 1
  739.                         %>
  740.                         <tr bgcolor=ffffff>
  741.                             <td>
  742.                                 <div 
  743.                                     class="small"
  744.                                     onclick="JavaScript:ToggleProxyRadio( <%= displayedElement %> );/*JumpToProxySettings();*/">
  745.                                 <input <% dwTabIndex = dwTabIndex + 1 %> 
  746.                                   type="radio" 
  747.                                   name="protocolList" 
  748.                                   value="<%= Server.HTMLEncode( strProtocol ) %>"
  749.                                   ID="<%= Server.HTMLEncode( strProtocol ) %>"  <%
  750.                                 if ( FALSE = bSomethingChecked ) and ( ( "" = GetPostOrQsVal("protocolList") ) or ( 0 = strcomp( strProtocol, GetPostOrQsVal("protocolList") ) ) ) then
  751.                                     Response.Write( "checked" )
  752.                                     bSomethingChecked = TRUE
  753.                                 end if
  754.                                 %> tabindex=<%= dwTabIndex %>> <label for="strProtocol" class="handcursor"><%= strProtocol %></label>
  755.                                 </div>
  756.                             </td>
  757.                             <td>
  758.                                 <div 
  759.                                     class="handcursor"
  760.                                     onclick="JavaScript:ToggleProxyRadio( <%= displayedElement %> );JumpToProxySettings();">
  761.                                       <%= Server.HTMLEncode( strProxyHostName ) %>
  762.                                 </div>
  763.                             </td>
  764.                         </tr>
  765.                         <% 
  766.                             end if
  767.                         next 
  768.                         %>
  769.                         </table>
  770.                         <tr>
  771.                             <td> </td>
  772.                             <td align=right>
  773.                                 <br><% dwTabIndex = dwTabIndex + 1 %>
  774.                                 <INPUT 
  775.                                     type="button" 
  776.                                     name="ProxySettings" 
  777.                                     onClick="JavaScript:JumpToProxySettings();" 
  778.                                     value="<%= Server.HTMLEncode( L_CONFIGUREELLIPSESBUTTON_TEXT ) %>" 
  779.                                     tabIndex=<%= dwTabIndex %>
  780.                                 > 
  781.                             </td>
  782.                         </tr>
  783.                     </table>
  784.                     </td></tr></table>
  785.                 </td>
  786.             </tr>
  787.         </table>
  788.         <% end if %>
  789.     </td>
  790. </tr>
  791. <tr>
  792.     <td>
  793.         <tr>
  794.             <td valign=bottom>
  795.                 <br><% dwTabIndex = dwTabIndex + 1 %>
  796.                 <input type="submit" align="baseline" name="ok"  tabIndex=<%= dwTabIndex %> value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>" id="ok"> 
  797.                 <% dwTabIndex = dwTabIndex + 1 %>
  798.                 <input type="button" align="baseline" name="cancel" onclick="JavaScript:Cancel();" tabIndex=<%= dwTabIndex %> value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>"> 
  799.                 <% dwTabIndex = dwTabIndex + 1 %>
  800.                 <input type="button" align="baseline" name="cancel" onclick="JavaScript:DoPluginHelp( '<%= H_NETSOURCETOPIC %>' );" tabIndex=<%= dwTabIndex %> value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>"> 
  801.             </td>
  802.         </tr>
  803.     </td>
  804. </tr>
  805. </form>
  806. </table>
  807. <%
  808. AlertUserWithPopupErrorDialog
  809. err.clear
  810. ClearError
  811. DrawStdFooter
  812. %>
  813. </body>
  814. </html>
  815. <%
  816. LatchCurrentPage "plugins/NetworkSource.asp", qs
  817. EndErrorHandling "NetworkSource.asp" 
  818.  
  819. on error resume next
  820. PluginsASPCleanup
  821. %>
  822.